<style>
    .notselect{display: none}
    .layui-body{position: inherit !important;margin: 0 !important;padding: 0 !important;}
</style>
<div class="layui-tab layui-tab-card think-bg-white">
    <div class="layui-tab-content">
        <fieldset>
            <legend>条件搜索</legend>
            <form action="{:request()->url()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">材料编号</label>
                    <label class="layui-input-inline">
                        <input class="layui-input" name="material_code" placeholder="请输入材料编号" value="{:input('material_code','')}">
                    </label>
                </div>

                <div class="layui-form-item layui-inline">
                    <label class="layui-form-label">材料名称</label>
                    <label class="layui-input-inline">
                        <input class="layui-input" name="material_name" placeholder="请输入材料名称" value="{:input('material_name','')}">
                    </label>
                </div>

                <div class="layui-form-item layui-inline">
                    <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
                </div>
            </form>
            <script>form.render()</script>
        </fieldset>
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th class='text-left nowrap'>材料编号</th>
                <th class='text-left nowrap'>材料名称</th>
                <th class='text-left nowrap'>型号/规格</th>
                <th class='text-left nowrap'>单位</th>
                <th class='text-left nowrap'>单价</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>

                <td class='list-table-check-td think-checkbox'>
                    <input class="list-check-box" value='{$vo|json_encode}' type='checkbox'>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-top sub-span-blue">
                        <div>编号：<span>{$vo.material_code|default='--'}</span></div>
                    </div>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-top sub-span-blue">
                        <div>名称：<span>{$vo.material_name|default='--'}</span></div>
                    </div>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-top sub-span-blue">
                        <div>规格：<span>{$vo.material_model|default='--'}</span></div>
                    </div>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-top sub-span-blue">
                        <div>单位：<span>{$vo.material_unit|default='--'}</span></div>
                    </div>
                </td>
                <td class='nowrap'>
                    <div class="inline-block text-top sub-span-blue">
                        <div>单价：<span>{$vo.material_price|default='--'}</span></div>
                    </div>
                </td>

            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
    <script>
        //获取选中数据
        function getCheckd(){
            var ids = [];
            $(".list-check-box:checked").each(function(i){
                var info = $(this).val()
                // var injson = JSON.parse(info);
                ids.push(info)
            })
            return ids;
        }
        layui.use('table', function(){
            var table = layui.table;
            //监听表格复选框选择
            table.on('checkbox(demo)', function(obj){
                console.log(obj)
            });

        });
    </script>
</div>